home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / pdftops / README < prev    next >
Text File  |  1996-05-24  |  17KB  |  533 lines

  1. xpdf
  2. ====
  3. and pdftops
  4.  
  5. version 0.5 (beta)
  6. 96-may-23
  7.  
  8. The xpdf and pdftops software and documentation are
  9. copyright 1996 Derek B. Noonburg.
  10.  
  11. Email: derekn@ece.cmu.edu
  12. WWW: http://www.contrib.andrew.cmu.edu/usr/dn0o/xpdf/xpdf.html
  13.  
  14. The PDF data structures, operators, and specification
  15. are copyright 1995 Adobe Systems Inc.
  16.  
  17.  
  18. What is xpdf?
  19. -------------
  20.  
  21. Xpdf is a viewer for Portable Document Format (PDF) files.  (These are
  22. also sometimes also called 'Acrobat' files, from the name of Adobe's
  23. PDF software.)  Xpdf runs under UNIX or VMS and the X Window System.
  24.  
  25. Xpdf is designed to be small and efficient.  It does not use the Motif
  26. or Xt libraries.  It uses standard X fonts.  Xpdf is quite usable on a
  27. 486-66 PC running Linux.
  28.  
  29.  
  30. Compatibility
  31. -------------
  32.  
  33. Xpdf is known to work on the following systems:
  34.  
  35. * x86, Linux 1.2.13 a.out, gcc 2.7.2
  36. * x86, Linux 1.2.13 ELF, gcc 2.7.2
  37. * PowerPC, AIX 4.1, gcc 2.7.0
  38. * SPARC, SunOS 4.1.3, gcc 2.7.2
  39. * MIPS, Ultrix 4.4, gcc 2.6.3
  40. * Alpha, OSF/1 3.2, gcc 2.7.0
  41. * HP-PA, HP-UX 9.05, gcc 2.7.2
  42.  
  43. It should work on pretty much any UNIX or VMS system which runs X11.
  44. You'll need ANSI C++ and C compilers to compile it.  If you compile it
  45. for a system not listed on the xpdf web page, please let me know.  If
  46. you're willing to make your binary available by ftp or on the web,
  47. I'll add a pointer to the web page.  If you can't get it to compile on
  48. your system, I'll try to help.
  49.  
  50.  
  51. Getting xpdf
  52. ------------
  53.  
  54. The latest version is available from:
  55.  
  56.   http://www.contrib.andrew.cmu.edu/usr/dn0o/xpdf/xpdf.html
  57.  
  58. or:
  59.  
  60.   ftp://ftp.andrew.cmu.edu/pub/xpdf/
  61.  
  62. Source code and several precompiled executables are available.
  63.  
  64. Announcements of new versions are posted to several newsgroups
  65. (comp.text.pdf, comp.os.linux.announce, and others) and emailed to a
  66. list of people.  If you'd like to receive email notification of new
  67. versions, just let me know.
  68.  
  69.  
  70. Running xpdf
  71. ------------
  72.  
  73. To run xpdf, simply type:
  74.  
  75.   xpdf file.pdf
  76.  
  77. where 'file.pdf' is your PDF file.  The file name can be followed by a
  78. number specifying the page which should be displayed first, e.g.:
  79.  
  80.   xpdf file.pdf 18
  81.  
  82. On-screen controls, at the bottom of the xpdf window:
  83.  
  84.   left/right arrow buttons:
  85.     Move to the previous/next page.
  86.  
  87.   'Page' entry box:
  88.     Move to a specific page number.  Click in the box to activate it,
  89.     type the page number, then hit return.
  90.  
  91.   magnifying glass buttons:
  92.     Increase and decrease the resolution, i.e., zoom in and zoom out.
  93.  
  94.   print button:
  95.     Bring up a dialog for generating a PostScript file.  The dialog
  96.     has options to set the pages to be printed and the PostScript file
  97.     name.
  98.  
  99.   curved arrow buttons:
  100.     Rotate the page clockwise and counterclockwise.  These are
  101.     intended primarily for PDF files where the rotation isn't
  102.     correctly specified in the file, but they're also useful if your X
  103.     server doesn't support font rotation.
  104.  
  105.   '?' button:
  106.     Bring up the 'about xpdf' window.
  107.  
  108.   'Quit' button:
  109.     Quit xpdf.
  110.  
  111. Links:
  112.  
  113.   Clicking on a hyperlink will jump to the link's destination.
  114.   Currently, only links within PDF documents or to another PDF file
  115.   are supported.  Clicking on a URL link just prints the URL.
  116.   Clicking on any other type of link (e.g., links to executable
  117.   programs) prints an error message.
  118.  
  119. Key bindings:
  120.  
  121.   n            move to the next page
  122.  
  123.   p            move to the previous page
  124.  
  125.   <Space>      scroll down on the current page; if already at bottom,
  126.   <PageDown>     move to next page
  127.   <Next>
  128.  
  129.   <Backspace>  scroll up on the current page; if already at top, move
  130.   <Delete>       to previous page
  131.   <PageUp> 
  132.   <Previous>
  133.  
  134.   <Home>       scroll to top of current page
  135.  
  136.   <End>        scroll to bottom of current page
  137.  
  138.   arrows       scroll the current page
  139.  
  140.   control-L    redraw the current page
  141.  
  142.   q            quit xpdf
  143.  
  144. Command line options and X resources:
  145.  
  146.   -err
  147.     Send error messages to /dev/tty instead of stderr (useful if xpdf
  148.     is started from another application, e.g., netscape which
  149.     otherwise pops up an annoying little window for every error).
  150.  
  151.   -z <number>                [xpdf.initialZoom]
  152.     Set the initial zoom factor (-5 .. 5).
  153.  
  154.   -g <geometry>              [xpdf.geometry]
  155.   -geometry <geometry>
  156.     Set the initial window geometry.
  157.  
  158.   -remote <name>
  159.     Start/contact xpdf remote server with specified name (see the
  160.     'Remote server mode' section below).
  161.  
  162.   -raise
  163.     Raise xpdf remote server window (with -remote only).
  164.  
  165.   -quit
  166.     Kill xpdf remote server (with -remote only).
  167.  
  168.   -rgb <number>
  169.     Set the size of largest RGB cube xpdf will try to allocate.  The
  170.     default is 5 (for a 5x5x5 cube); set to a smaller number to
  171.     conserve color table entries.
  172.  
  173.   -cmd
  174.     Print commands as they're executed (useful for debugging).
  175.  
  176.   -h or -help
  177.     Print usage information.
  178.  
  179. Several other standard X options and resources will work as expected:
  180.  
  181.   -display <display>         [xpdf.display]
  182.  
  183.   -foreground <color>        [xpdf.foreground]
  184.   -fg <color>
  185.  
  186.   -background <color>        [xpdf.background]
  187.   -bg <color>
  188.  
  189.   -font <font>               [xpdf.font]
  190.   -fn <font>
  191.  
  192. The color and font options only affect the user interface elements,
  193. not the PDF display (the 'paper').
  194.  
  195.  
  196. Web browsers
  197. ------------
  198.  
  199. If you want to run xpdf automatically from netscape or mosaic (and
  200. probably other browsers) when you click on a link to a PDF file, you
  201. need to edit (or create) the files '.mime.types' and '.mailcap' in
  202. your home directory.  In '.mime.types' add the line:
  203.  
  204.     application/pdf pdf
  205.  
  206. In '.mailcap' add the lines:
  207.  
  208.     # Use xpdf to view PDF files.
  209.     application/pdf; xpdf -err %s
  210.  
  211. Make sure that xpdf is on your executable search path.
  212.  
  213.  
  214. Remote server mode
  215. ------------------
  216.  
  217. Xpdf can be started in remote server mode by specifying a server name
  218. (in addition to the file name and page number).  For example:
  219.  
  220.   xpdf -remote myServer file.pdf
  221.  
  222. If there is currently no xpdf running in server mode with the name
  223. 'myServer', a new xpdf window will be opened.  If another command:
  224.  
  225.   xpdf -remote myServer another.pdf 9
  226.  
  227. is issued, a new copy of xpdf will not be started.  Instead, the first
  228. xpdf (the server) will load 'another.pdf' and display page nine.  If
  229. the file name is the same:
  230.  
  231.   xpdf -remote myServer another.pdf 4
  232.  
  233. the xpdf server will simply display the specified page.
  234.  
  235. The -raise option tells the server to raise its window; it can be
  236. specified with or without a file name and page number.
  237.  
  238. The -quit option tells the server to close its window and exit.
  239.  
  240.  
  241. Fonts
  242. -----
  243.  
  244. Xpdf uses X server fonts.  It requires the following fonts:
  245.  
  246. * courier: medium-r, bold-r, medium-o, and bold-o
  247. * helvetica: medium-r, bold-r, medium-o, and bold-o
  248. * times: medium-r, bold-r, medium-i, and bold-i
  249. * symbol: medium-r
  250. * Zapf Dingbats: medium-r
  251.  
  252. Most X installations should already have all of these fonts, except
  253. Zapf Dingbats (which isn't used very heavily anyway).
  254.  
  255. X servers, starting at R5, support font scaling.  Xpdf will
  256. automatically take advantage of this.  There are two types of scaling.
  257. The first type uses standard bitmap fonts: if a font doesn't exist in
  258. the requested size, the server will scale the bitmapped characters.
  259. This is reasonably fast, and the results are readable but not very
  260. pretty.  X servers can also handle true scalable, e.g., Type-1, fonts.
  261. (The free Adobe Acrobat Reader comes with a set of Type-1 fonts which
  262. can be used by X; see the mkfontdir(1) man page for details on setting
  263. these up.)  Scalable fonts are slower, especially since PDF documents
  264. tend to use lots of fonts, but they look much nicer.
  265.  
  266. Some X servers also support font rotation.  Xpdf will use this feature
  267. if available.
  268.  
  269.  
  270. PostScript output
  271. -----------------
  272.  
  273. Xpdf can generate PostScript files.  Click on the 'printer' button,
  274. select the pages you want to print and the name for the PostScript
  275. file, and click 'Ok' (or hit return).
  276.  
  277. There is also a separate program which converts PDF files to
  278. PostScript.  It runs from the command line, and can be compiled
  279. without the X includes and libraries.  To run it, type:
  280.  
  281.   pdftops file.pdf
  282.  
  283. to generate 'file.ps' or:
  284.  
  285.   pdftops file.pdf anotherfile.ps
  286.  
  287. to generate 'anotherfile.ps'.
  288.  
  289. You can specify a range of pages to convert:
  290.  
  291.   pdftops -f 3 -l 17 file.ps
  292.  
  293. will generate PostScript for pages 3 through 17.
  294.  
  295. Downloading fonts is not currently supported.  This means that if xpdf
  296. has trouble displaying the document, the PostScript output will
  297. probably look just as bad.
  298.  
  299. The generated PostScript is Level 2.  If you have an old printer which
  300. supports only Level 1 PostScript, you won't be able to print the
  301. files.  I'm not sure how many Level 1 printers are out there -- if you
  302. want Level 1 PostScript output, send me email, and if there's enough
  303. interest, I'll work on it.
  304.  
  305. The PostScript output has not been thoroughly tested yet.  Please send
  306. me email if you find any bugs.
  307.  
  308.  
  309. The Unisys LZW Patent
  310. ---------------------
  311.  
  312. Nearly all PDF files include data which has been compressed with the
  313. LZW compression algorithm.  Unfortunately, LZW is covered by a
  314. software patent which is owned by Unisys Corporation.  Unisys refuses
  315. to license this patent for PDF-related use in software such as xpdf
  316. which is released for free and which may be freely redistributed.
  317. (This is same algorithm which is used by GIF.  However, Unisys is not
  318. doing licensing for free PDF viwers in the same way as for free GIF
  319. viewers.)
  320.  
  321. As a workaround, xpdf converts PDF-format LZW data to compress-format
  322. LZW data.  (The standard UNIX compress utility also uses LZW, but with
  323. a slightly different file format.)  This conversion does *not*
  324. decompress the data; it simply converts it to a different file format.
  325. Xpdf then calls uncompress to actually decompress the data.
  326.  
  327. I have been told by several notable people that the LZW patent covers
  328. compression only, and does not cover decompression.  This seems pretty
  329. fuzzy to me, so I'm going to stick with my workaround, at least for
  330. now.
  331.  
  332. Software patents in general are a bad idea.  Consider supporting the
  333. League for Programming Freedom <http://www.lpf.org/>.
  334.  
  335. For Unisys's slant on things (mostly regarding GIF), see
  336. <http://www.unisys.com/LeadStory/lzwterms.html> and
  337. <http://www.unisys.com/LeadStory/lzwfaq.html>.  These pages mention
  338. an email address for feedback.
  339.  
  340.  
  341. Compiling xpdf
  342. --------------
  343.  
  344. Xpdf is written in C++ (with a little bit of C).  It should work with
  345. any ANSI-compliant C++ and C compilers.  The systems and compilers
  346. it's been tested with are listed on the xpdf web page.
  347.  
  348. To compile xpdf for UNIX:
  349.  
  350. * Edit Makefile.config in the top-level directory.  Set the compilers
  351.   you want to use (e.g., gcc and g++) and add any necessary switches
  352.   and options (e.g., include and library directories).
  353.  
  354. * If neither 'uncompress -c file.Z' nor 'gzip -d -c file.Z' decompress
  355.   a standard UNIX .Z file to stdout on your system, you'll need to
  356.   change uncompressCmd in xpdf/config.h.  This should not be necessary
  357.   on most systems.
  358.  
  359. * Type 'make' in the top-level directory to compile both xpdf and
  360.   pdftops.  If you only want to make one of the executables, type
  361.   'make xpdf' or 'make pdftops'.
  362.  
  363. * If nothing goes wrong, the executables will be left in xpdf/xpdf and
  364.   xpdf/pdftops.  There are no runtime configuration or support files;
  365.   the binary can be moved to any directory.
  366.  
  367. * If desired, type 'make PREFIX=/usr/local install'.  (You can change
  368.   '/usr/local' to some other directory, of course.)
  369.  
  370. To compile xpdf for VMS:
  371.  
  372. * There are two sets of scripts: vmscomp.com (for gcc on VAX) and
  373.   vmsdecccomp.com (for DEC C on Alpha).  There are four of each: in
  374.   the top-level directory, [.goo], [.ltk], and [.xpdf].  You may need
  375.   to edit these scripts as appropriate for your system.
  376.  
  377. * The 'stddef.h' include file which comes with older versions of gcc
  378.   may be missing a definition for wchar_t.  In this case, add the
  379.   following lines:
  380.   -----
  381.   File GNU_CC:[INCLUDE]STDDEF.H;2
  382.    44   /* Wide characters, not yet supported by VAXCRTL [match VAXC's <stddef.
  383.    45   #if !defined(_WCHAR_T) && !defined(_WCHAR_T_)
  384.    46   typedef unsigned int wchar_t;
  385.    47   #endif
  386.    48   #define _WCHAR_T
  387.    49   #define _WCHAR_T_
  388.    50
  389.   -----
  390.  
  391. * Type '@vmscomp.com' or '@vmsdecccomp' in the top-level directory.
  392.  
  393. * The executables will be left in '[.xpdf]xpdf' and '[.xpdf]pdftops'.
  394.  
  395.  
  396. Distribution
  397. ------------
  398.  
  399. Xpdf may be distributed under the following conditions:
  400.  
  401. 1. This file ('README') is included, unmodified, in the distribution.
  402.  
  403. 2. The distribution includes:
  404.    a. all of the xpdf source code, unmodified; OR
  405.    b. one or more xpdf executables, compiled from the unmodified
  406.       source code; OR
  407.    c. both of the above.
  408.  
  409. If you distribute xpdf, I would appreciate receiving a pointer (ftp
  410. site, BBS phone number, etc.) or a copy (disk, CD-ROM, etc.).
  411.  
  412. Modified versions of xpdf or applications using some or all of the
  413. xpdf code (i.e., 'derivative works' under copyright law) may not be
  414. distributed without explicit permission.
  415.  
  416.  
  417. Bugs
  418. ----
  419.  
  420. This is an beta release of xpdf, and there are still a bunch of PDF
  421. features which I have yet to implement.
  422.  
  423. At this point, the biggest problem is that embedded fonts are not
  424. handled correctly.
  425.  
  426. If you find a bug in xpdf, i.e., if it prints an error message,
  427. crashes, or incorrectly displays a document, and you don't see that
  428. bug listed here, please send me email, with a pointer (URL, ftp site,
  429. etc.) to the PDF file.
  430.  
  431. This is a list of things which I plan to add (in approximate order of
  432. priority):
  433.  
  434. * forms
  435. * text search/select/copy
  436. * separate program to extract all text from PDF file
  437. * text annotations
  438. * bookmarks
  439. * support for Adobe Acrobat Amber optimized PDF files
  440. * article threads
  441. * index window or mode -- outline and/or thumbnails
  442. * distribute with a small demo PDF file
  443. * RunLength filter (I haven't found a PDF file which uses this)
  444. * encryption (if I can get documentation)
  445. * adding text to clipping path
  446. * miter limit
  447. * text rendering mode (X display and PostScript output)
  448. * separate pdftoppm program (args are PDF file, page number, and
  449.   resolution (in dpi))
  450.  
  451. There are also some problems which I know about.  This is a list of
  452. things which I plan to fix:
  453.  
  454. * handle embedded Type-1 and Type-3 fonts
  455.   - on screen (dump Type-1 fonts to file and let X server load them?)
  456.   - embed in PostScript files
  457. * "cancel" button to stop page computation
  458. * pan by dragging with button 2
  459. * do a better job of scaling and dithering images
  460.   - look at 'Interpolate' param;
  461. * rotated (non-90) images
  462. * fix trademark ('TM') constructed char to use smaller font
  463. * greek small fonts
  464. * deal better with file names in GoToR links
  465. * deal better with TrueColor visuals (don't use RGB cube)
  466. * option and resource for private color map
  467. * "load file" button, file dialog
  468. * mark links on screen
  469. * support other link types
  470. * some kind of 'configure' script to build Makefile.config
  471. * "save bitmap" (PPM) command (how to generate 24-bit image?)
  472. * efficiently handle very large files - don't read entire catalog,
  473.   xref, etc. (is this necessary?)
  474. * don't allocate full-size pixmap (optional?  only if > N bytes?)
  475.  
  476.  
  477. Acknowledgments
  478. ---------------
  479.  
  480. Thanks to:
  481.  
  482. * Patrick Voigt for help with the remote server code.
  483. * Patrick Moreau for the VMS port.
  484. * David Boldt and Rick Rodgers for sample man pages.
  485.  
  486.  
  487. References
  488. ----------
  489.  
  490. Adobe Systems Inc., _Portable Document Format Reference Manual_.
  491. Addison-Wesley, 1993, ISBN 0-201-62628-4.
  492. [The manual for PDF version 1.0.  The updated version (for PDF 1.1) is
  493. available on the net from http://www.adobe.com/Support/TechNotes.html
  494. or ftp://ftp.adobe.com/pub/adobe/Acrobat/SDK/TECHDOC/PDFSPEC.PDF.]
  495.  
  496. Adobe Systems Inc., _Updates to the Portable Document Format Reference
  497. Manual_, Adobe Developer Support Technical Note #5156.  1995.
  498. [Updates for PDF version 1.1.  Available on the WWW as
  499. http://www.adobe.com/PDFs/TN/5156.PDF_UPD.PDF.]
  500.  
  501. Adobe Systems Inc., _PostScript Language Reference Manual_, 2nd ed.
  502. Addison-Wesley, 1990, ISBN 0-201-18127-4.
  503. [The official PostScript manual.]
  504.  
  505. Adobe Systems Inc., _Supporting the DCT Filters in PostScript Level
  506. 2_, Adobe Developer Support Technical Note #5116.  1992.
  507. [Description of the DCTDecode filter parameters.]
  508.  
  509. CCITT, _Blue Book_, Volume VII Fascicle 3: "Terminal Equipment and
  510. Protocols for Telematic Services", Recommendations T.4 and T.6.
  511. [The official Group 3 and 4 fax standards.  These are available on the
  512. net (but misformatted) as
  513. ftp://ftp.uu.net/doc/standards/ccitt/1988/7_3_01.ps and 7_3_02.ps.]
  514.  
  515. Foley, van Dam, Feiner, and Hughes, _Computer Graphics: Principles and
  516. Practice_, 2nd ed.  Addison-Wesley, 1990, ISBN 0-201-12110-7.
  517. [Colorspace conversion functions, Bezier spline math.]
  518.  
  519. Robert L. Hummel, _Programmer's Technical Reference: Data and Fax
  520. Communications_.  Ziff-Davis Press, 1993, ISBN 1-56276-077-7.
  521. [CCITT Group 3 and 4 fax decoding.]
  522.  
  523. Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, "Practical
  524. Fast 1-D DCT Algorithms with 11 Multiplications".  IEEE Intl. Conf. on
  525. Acoustics, Speech & Signal Processing, 1989, 988-991.
  526. [The fast IDCT algorithm used in the DCTDecode filter.]
  527.  
  528. Gregory K. Wallace, "The JPEG Still Picture Compression Standard".
  529. [Good description of the JPEG standard.  Available on the net as
  530. ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  Also published in CACM,
  531. April 1991, and submitted to IEEE Transactions on Consumer
  532. Electronics.]
  533.